<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <title>飞腾会-FitaClub</title>
  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>
</head>
<!-- end header -->

<body>
<div class="page-group">
  <div class="page page-current bg-light-gray">
    <header class="bar bar-nav fita-header">
      <a href="javascript:history.back(-1);" class="icon icon-left pull-left"></a>
      <a class="icon icon-menu pull-right open-panel"></a>
      <h1 class="title">我的FITA</h1>
    </header>
    <div class="content profile-fita-content">
      <div class="list-content">
        <div class="list-block list-container" style="margin: .5rem;">
          <c:forEach items="${secondaryAgents}" var="sa">
            <div class="item-content">
              <div class="row" style="width: 100%; margin-left: 0;">
                <div class="col-100 fita-title">
                  <div class="name">${sa.name} ${sa.company.type.company ? "(" += sa.company.companyName += ")" : ""}</div>
<%--
                  <div class="label">${saa.status.description}</div>
--%>
                </div>
                <div class="col-50 detail">
                  <div class="item">
                    <p class="no-margin">电话：${sa.mobile}</p>
                    <p class="no-margin">邮箱： ${sa.email}</p>
                    <c:if test="${not empty agent}">
                      <p class="no-margin">累计提成： ${sa.totalCommission}元</p>
                    </c:if>
                  </div>
                  <a href="${ctx.host}/profile/secondary-agents/${sa.id}/edit-commission-rate"
                     class="button edit-button" data-toggle="push">修改提成率</a>
                </div>
                <div class="col-50 royalty">
                  <div class="item">
                    <p class="no-margin">提成率：${sa.company.primaryAgentRate}%</p>
                    <p class="no-margin">订单金额： ${sa.totalOrderMoneyAmount}元</p>
                  </div>
                  <a href="${ctx.host}/profile/secondary-agents/${sa.id}?everyPage=6" class="button "> 查看明细</a>
                </div>
              </div>
            </div>
          </c:forEach>
        </div>
      </div>

    </div>
  </div>

  <div class="panel-overlay"></div>
  <div class="panel panel-right panel-cover fita-panel">
    <div class="list-block contacts-block no-margin">
      <p class="menu-title close-panel">关闭</p>
      <ul>
        <li>
          <a href="${ctx.host}/cars/search" class="item-content item-link">
            <div class="item-inner">
              <div class="item-title">立即租车</div>
            </div>
          </a>
        </li>
        <li>
          <a href="${ctx.host}/orders" class="item-content item-link">
            <div class="item-inner">
              <div class="item-title">我的订单</div>
            </div>
          </a>
        </li>
      </ul>
    </div>
  </div>
</div>
<!-- <a ctx.host="/order/order-staying-list">保留预定</a>
<a ctx.host="/order/order-unpaid-list">未支付</a>
<a ctx.host="/order/order-paid-list">已支付</a>
<a ctx.host="/order/order-finished-list">已完成</a> -->
<%@ include file="/WEB-INF/include/script.jsp" %>
<d:resource type="script" root="${ctx.resource}/build" src="js/page/profile/profile-fita.js"/>
<script type="text/javascript">
    require(['page/profile/profile-fita'], function (page) {
        page.init()
    })
</script>

</body>
</html>